<!doctype html>
<html>
<head>
<meta name="format-detection"  content="telephone=no">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
<meta  http-equiv="x-rim-auto-match" content="none">
<meta charset="UTF-8">
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0;" name="viewport;">
<meta content="user-scalable=no" name="viewport">
<title>至富通</title>
<script src="http://__JS__/jquery.js"></script>
<script src="http://__JS__/jquery-1.8.3.min.js"></script>   
<script src="http://__THEMES__/js/aui.js"></script>  
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>   
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.4&key=013942c74f234d17b73396781444748a"></script>                              
<link href="http://__CSS__/my-style.css" rel="stylesheet" type="text/css">
<link rel="icon" href="http://__IMG__/favicon.ico">
</head>
<style>
.guidong{}
#diva{display:black;width:400px;height:50px;line-height:50px;white-space:nowrap;overflow:hidden;margin:15px;padding:5px 15px;}
.guidong span{display:inline-block;padding-right:20px;}
</style>
<body style="background:#FFF;">
<!--首页，钱包-->
<header class="b-logo">

<div class="" style="margin-top:20px; float:left;">
</div>
<!--搜索框-->
<div class="gover_search">
 <div class="gover_search_form clearfix"> 
 <form action="__URL__ShowController/QueryZhiFu">
 <span class="search_t"></span>
 <input type="text" name="store_name" class="input_search_key" id="gover_search_key" placeholder="输入店铺名可直接搜索"/>
 <button type="submit" class="search_btn">搜索</button>
 <div class="search_suggest" id="gov_search_suggest">
  <ul>
  </ul>
 </div>
 </form>
 </div>
</div>
</header>
<!--轮播图-->
	<div class="aui-content-box">
		<div class="aui-banner-content aui-fixed-top" data-aui-slider>
			<div class="aui-banner-wrapper">
				<!--<div class="aui-banner-wrapper-item"> -->
 				<!-- <a href="http://www.zfshlm.com/index/"> -->
 				<!--	<img src="../../../themes/img/banner/test.png"> </a> -->
				<!--</div> -->
				<div class="aui-banner-wrapper-item">
					<!-- <a href="#"> -->
						<img src="http://__THEMES__/img/banner/banner.jpg">
					<!-- </a> -->
				</div>
				<div class="aui-banner-wrapper-item">
					<!-- <a href="#"> -->
						<img src="http://__THEMES__/img/banner/banner1.jpg">
					<!-- </a> -->
				</div>

				<div class="aui-banner-wrapper-item">
				<!-- 	<a href="#"> -->
						<img src="http://__THEMES__/img/banner/banner2.jpg">
					<!-- </a> -->
				</div>
			</div>
			<div class="aui-banner-pagination"></div>
		</div>
        <!--轮播图-->
       <div style="margin-top:35px;">
         {volist name="themelist" id="tl" offset="0" length='1'}
        <a href="__URL__ShowController/showStoreForTrade?trade_id={$tl.id}">
        <div class="hytb1"><img src="http://__THEMES__/{$tl.themes_imgurl}"><p> {$tl.trade_name}</p></div></a>
          {/volist}
          {volist name="themelist" id="tl" offset="1" length='4'}
        <a href="__URL__ShowController/showStoreForTrade?trade_id={$tl.id}"><div class="hytb-all"><img src="http://__THEMES__/{$tl.themes_imgurl}"><p> {$tl.trade_name}</p></div></a>
          {/volist}
          </div>
           <div style="margin-top:87px; float:left;">
         {volist name="themelist" id="tl" offset="5" length='1'}
        <a href="__URL__ShowController/showStoreForTrade?trade_id={$tl.id}"><div class="hytb1"><img src="http://__THEMES__/{$tl.themes_imgurl}"><p> {$tl.trade_name}</p></div></a>
          {/volist}
          {volist name="themelist" id="tl" offset="6" length='4'}
        <a href="__URL__ShowController/showStoreForTrade?trade_id={$tl.id}"><div class="hytb-all"><img src="http://__THEMES__/{$tl.themes_imgurl}"><p> {$tl.trade_name}</p></div></a>
          {/volist}
          </div>

<!--灰边-->
<div class="huihui" style="margin-top:45px; margin-bottom:10px; float:left;"></div>
<!--灰边-->
<!--为你推荐-->
<div class="hbk"> 
  <div class="hbk-wz">
   <img src="http://__IMG__/love.png" style="vertical-align:middle;">
    <span style="color:black; font-family:'微软雅黑'; vertical-align:middle; font-size:42px; font-weight:600;">为你推荐</span>
  </div>
   <div class="hxhx"></div>
</div>
<!--为你推荐-->
 <span id="xy"></span>
<div class="ggzs">
 <div class="ggzschi">
  <div class="biaoqian1">吃的开心</div>
   <div class="ggwzwz1">广告招商<br><span style=" margin-left:18px;">虚位以待</span></div>
    <div class="hywzwz1">小吃快餐</div>
     <div><img src="http://__IMG__/chwl1.jpg" width="290" style="margin:10px 0 0 100px; border-radius:50%;"></div>
 </div>
  <div class="ggzshe">
   <div class="biaoqian2">唱的痛快</div>
    <div class="ggwzwz2">广告招商<span style=" margin-left:9px;">虚位以待</span></div>
     <div class="hywzwz2">KTV</div>
      <div><img src="http://__IMG__/chwl2.jpg" width="300" style="border-radius:50%; position:absolute; top:80px; right:-20px;"></div>
  </div>
   <div class="ggzswan">
    <div class="biaoqian3">住的安逸</div>
     <div class="ggwzwz3">等你加入</div>
      <div class="hywzwz3">酒店宾馆</div>
      <div><img src="http://__IMG__/chwl3.jpg" width="150" style="border-radius:50%; position:absolute; top:180px; right:-10px;"></div>
   </div>
    <div class="ggzsle">
     <div class="biaoqian4">玩的新颖</div>
      <div class="ggwzwz4">等你加入</div>
       <div class="hywzwz4">休闲度假</div>
        <div><img src="http://__IMG__/chwl4.jpg" width="150" style="border-radius:50%; position:absolute; top:180px; right:-10px;"></div>
    </div>
</div>
<!--活动宣传-->
<img src="http://__IMG__/zftxf.jpg" style=" width:100%; margin:10px 0 3px;">
<!--活动宣传-->
<!--灰边-->
<div class="huihui" style="margin-bottom:10px;"></div>
<!--灰边-->
<!--附近店铺-->
  <div class="hbk">
   <div class="hbk-wz">
   <img src="http://__IMG__/fangzi.png" style="vertical-align:middle;">
    <span style="color:black; font-family:'微软雅黑'; vertical-align:middle; font-size:42px; font-weight:600;">附近店铺</span>
  </div>
   <div class="hxhx"></div>
  </div>
<!--附近店铺-->
  
  
  <!--商家卡片--> 	
		  <div id ="stores">
</div>
<script>
$(function() {
	mapObj = new AMap.Map('');
    mapObj.plugin('AMap.Geolocation', function () {
        geolocation = new AMap.Geolocation();
        mapObj.addControl(geolocation);
        geolocation.getCurrentPosition();
        AMap.event.addListener(geolocation, 'complete', onComplete);//返回定位信息
        AMap.event.addListener(geolocation, 'error', onError);      //返回定位出错信息
    });
  //解析定位结果
	var a = 2;
	var i = 0;
    function onComplete(data) {
		var dis = data.position;
		$.ajax({
			type : "get",
			url: "__URL__ShowController/distance/dis/"+dis,
			dataType: "json",
			success:function(data){
				var num = 1;
				$(window).scroll(function(){
					if($(window).scrollTop()>0&& num != 200) {
						for(;i<a;i++){
							var json = eval("("+data[i]+")");
							if(json['distance']<=30000){
								var distance = "";
								if(json['distance']>1000){
									distance = (json['distance']/1000).toFixed(2)+"km";
								}else{
									distance = Number(json['distance']).toFixed(2)+"m";
								}
								$("#stores").append("<a href='__URL__ShowController/zhifw?id="+json['id']+"'><div class='baika'><div class='baika2'><div class='tubaika'><img src='http://47.93.11.60/zfshlm/public/upload/"
								+json['imgurl']+"'></div><div class='xxbaika'><h1>"+json['store_name']
								+"</h1><h2><img src='http://__IMG__/star.png' width='250'><span><p class='yangshi1'>抢购</p></span></h2><h3 style='width:600px; height:45px; overflow:hidden;'><span><img src='http://__IMG__/location.png' width='35'></span>"+json['address']
								+"</h3><h4 style='width:575px; height:45px; overflow:hidden;'><span><img src='http://__IMG__/dianhua.png' width='35' style='margin-right:3px; margin-bottom:-2px;'></span><a href='tel:"+json['phone']+"'>"+json['phone']
								+"</a><p class='yangshi2'><span>"+distance+"</span></p></h4></div></div></div><div class='huihui'></div></a>");
								}
						}
						num++;
						a = a+2;
					}
				});
			}
		}); 
    }
});

</script>
</script>
  <!-- </foreach> -->
  		<script type="text/javascript">
				history.pushState(null, null, location.href);
				window.addEventListener('popstate', function(event) {
    			history.pushState(null, null, location.href );
    			//此处加入回退时你要执行的代码
   				 wx.closeWindow();
				}); 
		</script>

<!--智能搜索框
<script type="text/javascript" src="http://www.softwhy.com/mytest/jQuery/jquery-1.8.3.js"></script>-->
<script type="text/javascript"> 

function oSearchSuggest(searchFuc)
{ 
 var input = $('#gover_search_key'); 
 var suggestWrap = $('#gov_search_suggest'); 
 var key = ""; 
 var init = function(){ 
 input.bind('keyup',sendKeyWord); 
 input.bind('blur',function(){setTimeout(hideSuggest,100);}) 
 } 
 var hideSuggest = function(){ 
 suggestWrap.hide(); 
 } 
 //发送请求，根据关键字到后台查询 
 var sendKeyWord = function(event){ 
 //键盘选择下拉项 
 if(suggestWrap.css('display')=='block'&&event.keyCode == 38||event.keyCode == 40)
 { 
  var current = suggestWrap.find('li.hover'); 
  if(event.keyCode == 38)
  { 
  if(current.length>0)
  { 
   var prevLi = current.removeClass('hover').prev(); 
   if(prevLi.length>0)
   { 
   prevLi.addClass('hover'); 
   input.val(prevLi.html()); 
   } 
  }
  else
  { 
   var last = suggestWrap.find('li:last'); 
   last.addClass('hover'); 
   input.val(last.html()); 
  } 
  }
  else if(event.keyCode == 40)
  { 
  if(current.length>0)
  { 
   var nextLi = current.removeClass('hover').next(); 
   if(nextLi.length>0)
   { 
   nextLi.addClass('hover'); 
   input.val(nextLi.html()); 
   } 
  }
  else
  { 
   var first = suggestWrap.find('li:first'); 
   first.addClass('hover'); 
   input.val(first.html()); 
  } 
  } 
  //输入字符 
 }
 else
 { 
  var valText = $.trim(input.val()); 
  if(valText ==''||valText==key)
  { 
  return; 
  } 
  searchFuc(valText); 
  key = valText; 
 } 
 } 
 //请求返回后，执行数据展示 
 this.dataDisplay = function(data){ 
 if(data.length<=0)
 { 
  suggestWrap.hide(); 
  return; 
 } 
 //往搜索框下拉建议显示栏中添加条目并显示 
 var li; 
 var tmpFrag = document.createDocumentFragment(); 
 suggestWrap.find('ul').html(''); 
 for(var i=0; i<data.length; i++)
 { 
  li = document.createElement('LI'); 
  li.innerHTML = data[i]; 
  tmpFrag.appendChild(li); 
 } 
 suggestWrap.find('ul').append(tmpFrag); 
 suggestWrap.show(); 
 //为下拉选项绑定鼠标事件 
 suggestWrap.find('li').hover(function(){ 
  suggestWrap.find('li').removeClass('hover'); 
  $(this).addClass('hover'); 
 },function(){ 
  $(this).removeClass('hover'); 
 }).bind('click',function(){ 
  $(this).find("span").remove(); 
  input.val(this.innerHTML); 
  suggestWrap.hide(); 
 }); 
 } 
 init(); 
}; 
//实例化输入提示的JS,参数为进行查询操作时要调用的函数名 
var searchSuggest = new oSearchSuggest(sendKeyWordToBack); 
//这是一个模似函数，实现向后台发送ajax查询请求，并返回一个查询结果数据，传递给前台的JS,再由前台JS来展示数据。本函数由程序员进行修改实现查询的请求 
//参数为一个字符串，是搜索输入框中当前的内容 
function sendKeyWordToBack(keyword){ 
	$.ajax({
		type : "get",
		url: "__URL__ShowController/ajaxShowStore?keyword="+keyword,
		dataType: "json",
		success:function(data){
			 var aData = []; 
			$.each(data, function(index, val) {
				//alert(val.id);
				aData.push(val.store_name);
				});
			
		
			 //将返回的数据传递给实现搜索输入框的输入提示js类 
			 searchSuggest.dataDisplay(aData); 
		}
	});
 //将返回的数据传递给实现搜索输入框的输入提示js类 
 searchSuggest.dataDisplay(aData); 
} 
</script>

</body>
</html>
